package com.sz.designpattern.create5.builder;

public class Config {
    private final String mX1;
    private final int mX2;

    private Config(Builder builder) {
        mX1 = builder.mX1;
        mX2 = builder.mX2;
    }

    public static final class Builder {
        private String mX1;
        private int mX2;

        public Builder() {
        }

        public Builder setX1(String val) {
            mX1 = val;
            return this;
        }

        public Builder setX2(int val) {
            mX2 = val;
            return this;
        }

        public Config build() {
            return new Config(this);
        }
    }
}
